<template>
  <a-modal
    v-if="modalTag"
    :title="title"
    :visible="modalTag"
    :footer="null"
    :centered="true"
    :width="width"
    @cancel="modalTag = false"
  >
    <slot />
  </a-modal>
</template>

<script setup>
import {defineExpose, defineProps, ref, computed} from "vue";

const props = defineProps({
  title: {
    type: String,
    default: '请输入内容'
  },
  width: {
    type: String,
    default: '95%'
  },
  visible: {
    type: Boolean,
    default: false
  }
})

let modalTag = ref(false);

const open = () => {
  modalTag.value = true
}

const close = () => {
  modalTag.value = false
}

defineExpose({open, close})

</script>

<style scoped>

</style>